package C013;

import java.util.LinkedList;
import java.util.Queue;

/**
 * ClassName: Queue01
 * Package: C013
 * Description:
 *
 * @Author BCXJ
 * @Create 2024/12/2 11:48
 * @Version 1.0
 * @Since 1.0
 */
public class Queue01 {
    public static void main(String[] args) {
        JDKQueue<Integer> queue = new JDKQueue<>();

        System.out.println(queue.isEmpty());
        queue.offer(11);
        queue.offer(10);
        queue.offer(12);
        queue.offer(13);
        System.out.println(queue.peek());
        System.out.println(queue.poll());
        System.out.println(queue.peek());
    }



    static class JDKQueue<T> {
        Queue<T> queue = new LinkedList<T>();


        public T peek() {
            return queue.peek();
        }

        public boolean isEmpty() {
            return queue.isEmpty();
        }

        public boolean offer(T item) {
            return queue.offer(item);
        }

        public T poll() {
            return queue.poll();
        }

        public int size() {
            return queue.size();
        }
    }
}
